<%@ Page Language="VB" MasterPageFile="~/MasterPage.master" AutoEventWireup="false"
    CodeFile="IPLocationDataMaintain.aspx.vb" Inherits="WebForm_OtherData_IPLoactionMaintain" %>

<%@ Register Assembly="FredCK.FCKeditorV2" Namespace="FredCK.FCKeditorV2" TagPrefix="FCKeditorV2" %>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
        <ContentTemplate>
            <asp:HiddenField ID="hiUID" runat="server" />
            <asp:HiddenField ID="hiDBName" runat="server" />
           
            <asp:ObjectDataSource ID="dbIPLocData" runat="server" SelectMethod="GetIPLocationData" 
                 TypeName="AssetManage.BBL.IPLocationDataBBL"
                InsertMethod="InsertIPLocationData" DeleteMethod="DeleteIPLocationData">
                <DeleteParameters>
                        <asp:Parameter Name="Site" Type="String" />
                        <asp:Parameter Name="Location" Type="String" />
                        <asp:Parameter Name="IP_Beg" Type="String" />
                        <asp:Parameter Name="IP_End" Type="String" />
                        <asp:ControlParameter ControlID="hiDBName" Name="dbName" PropertyName="Value" 
                        Type="String" />
                </DeleteParameters>
                <SelectParameters>
                           <asp:ControlParameter ControlID="txtIP" ConvertEmptyStringToNull="False" 
                            Name="IP_Beg" PropertyName="Text" Type="String"  DefaultValue =""/>
                           <asp:ControlParameter ControlID="txtLocation" ConvertEmptyStringToNull="False" 
                            Name="Location" PropertyName="Text" Type="String"  DefaultValue =""/>
                           <asp:ControlParameter ControlID="ddlFactory" ConvertEmptyStringToNull="False" 
                           Name="Site" PropertyName="SelectedValue" Type="String" DefaultValue ="" />
                           <asp:ControlParameter ControlID="hiDBName" Name="dbName" PropertyName="Value" 
                           Type="String" />
                </SelectParameters>
                <InsertParameters>
                    <asp:ControlParameter ControlID="ddlpopFactory" Name="Site"  ConvertEmptyStringToNull="False" 
                        PropertyName="SelectedValue" Type="String" DefaultValue ="" />
                    <asp:ControlParameter ControlID="txtpopLocation" ConvertEmptyStringToNull="False" 
                         Name="Location" PropertyName="Text" Type="String"  DefaultValue =""/>
                    
                    <asp:ControlParameter ControlID="txtpopIP" ConvertEmptyStringToNull="False" 
                            Name="IP_Beg" PropertyName="Text" Type="String"  DefaultValue =""/>
                    <asp:ControlParameter ControlID="txtpopEndIP" ConvertEmptyStringToNull="False" 
                            Name="IP_End" PropertyName="Text" Type="String"  DefaultValue =""/>
       
                    <asp:ControlParameter ControlID="hiUID" Name="UID" PropertyName="Value" 
                        Type="String" />
                    <asp:ControlParameter ControlID="hiDBName" Name="dbName" PropertyName="Value" 
                        Type="String" />
                </InsertParameters>
             </asp:ObjectDataSource>
            <asp:ObjectDataSource ID="dbOAFactory" runat="server" 
                SelectMethod="GetOAFactory" TypeName="AssetManage.BBL.AssetBBL">
                <SelectParameters>
                    <asp:Parameter DefaultValue="1" Name="kind" Type="String" />
                    <asp:ControlParameter ControlID="hiDBName" DefaultValue="" Name="dbName" 
                        PropertyName="Value" Type="String" />
                </SelectParameters>
            </asp:ObjectDataSource>
            <table border="1" width="1000px">
                <tr>
                    <td style="text-align: center" colspan ="6">
                        <asp:Label ID="lblTitle" runat="server"   meta:resourcekey="lblTitle" Font-Bold="True"
                            Font-Size="24px"></asp:Label>
                    </td>
                </tr>
                <tr>
                    <td style="text-align: right">
                       <asp:Label ID="lblIP" runat="server"   meta:resourcekey="lblIP"></asp:Label></td>
                         <td>
                             <asp:TextBox ID="txtIP" runat="server">...</asp:TextBox>
                       </td>
                         <td style="text-align: right">
                         <asp:Label ID="lblLocation" runat="server"   meta:resourcekey="lblLocation"></asp:Label>
                       </td>
                         <td>
                             <asp:TextBox ID="txtLocation" runat="server"></asp:TextBox>
                       </td>
                        <td style="text-align: right">
                          <asp:Label ID="lblFactory" runat="server"   meta:resourcekey="lblFactory"></asp:Label>
                        </td>
                         <td>
                         <asp:DropDownList runat="server" ID="ddlFactory"  DataTextField="name"
                            DataValueField="id" DataSourceID="dbOAFactory" AutoPostBack="True">
                        </asp:DropDownList>
                       </td>
                </tr>
                <tr>
                    <td style="text-align: left" colspan ="6">
                       <asp:Label ID="lblImport" runat="server" meta:resourcekey="lblImport" />
                       <asp:FileUpload ID="fuImport" runat="server"></asp:FileUpload>
                       <asp:Button ID="btnImport" runat="server" meta:resourcekey="btnImport" />
                       <asp:HyperLink ID="hlImport"  runat="server"  meta:resourcekey="hlImport" 
                            NavigateUrl="~/Imports/Sample/IPListSample.xls" />
                    </td>
                </tr>
                <tr>
                    <td style="text-align: center" colspan ="6">
                        <asp:Button ID="btnQuery" runat="server" meta:resourcekey="btnQuery" />
                         <asp:Button ID="btnInsert" runat="server" meta:resourcekey="btnInsert" />
                    </td>
                </tr>
                 <tr style="vertical-align: text-top">
                    <td colspan="6">
                        <asp:Panel ID="plInsert" runat="server" BackColor="#E7FEC2" Height="100px" 
                            Width="800px">
                            <table border="1">
                                <tr>
                                      <td style="text-align: right">
                                       <asp:Label ID="lblpopIP" runat="server"   meta:resourcekey="lblpopIP"></asp:Label>
                                      </td>
                                       <td>
                                             <asp:TextBox ID="txtpopIP" runat="server">...</asp:TextBox>~<asp:TextBox ID="txtpopEndIP" runat="server">...</asp:TextBox></td>
                                       <td style="text-align: right">
                                         <asp:Label ID="lblpopLocation" runat="server"   meta:resourcekey="lblpopLocation"></asp:Label>
                                       </td>
                                        <td>
                                             <asp:TextBox ID="txtpopLocation" runat="server"></asp:TextBox>
                                       </td>
                                        <td style="text-align: right">
                                          <asp:Label ID="lblpopFactory" runat="server"   meta:resourcekey="lblpopFactory"></asp:Label>
                                        </td>
                                        <td>
                                         <asp:DropDownList runat="server" ID="ddlpopFactory"  DataTextField="name"
                                            DataValueField="id" DataSourceID="dbOAFactory" AutoPostBack="True">
                                        </asp:DropDownList>
                                       </td>
                                </tr>
                                <tr>
                                    <td align="center" colspan="6">
                                        <asp:Button ID="btnSave" runat="server" meta:resourcekey="btnSave" />
                                        <asp:Button ID="btnCancel" runat="server" meta:resourcekey="btnCancel" />
                                    </td>
                                </tr>
                            </table>
                           <br />
                         </asp:Panel>
                         <ajaxToolkit:ModalPopupExtender ID="mpIns" runat="server" 
                            PopupControlID="plInsert" TargetControlID ="btnInsert" PopupDragHandleControlID="plInsert"
                            CancelControlID="btnCancel" X="20" Y="50" BehaviorID="mpIns">
                        </ajaxToolkit:ModalPopupExtender>
                        
                        <TServerControl:TGridView ID="gvIPLocData" runat="server" DataKeyNames="Site,Location,IP_Beg,IP_End" 
                            AllowHoverEffect="False" AllowHoverSelect="False" AllowPaging="True" 
                            AutoGenerateColumns="False" DataSourceID="dbIPLocData" ShowFooterWhenEmpty="False" 
                            ShowHeaderWhenEmpty="True" SkinID="pager" TotalRowCount="0" Width="900px">
                            <Columns>
                                
                                 <asp:TemplateField>
                                    <ItemTemplate>
                                        <asp:Button ID="btnDelete" runat="server" meta:resourcekey="btnDelete" CommandName ="Delete" ></asp:Button>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:BoundField meta:resourcekey="gvFactory" DataField="Site" />
                                <asp:BoundField meta:resourcekey="gvLoc" DataField="Location" />
                                <asp:BoundField meta:resourcekey="gvBeginIP" DataField ="IP_Beg"/>
                                <asp:BoundField meta:resourcekey="gvEndIP" DataField="IP_End" />
                              
                            </Columns>
                            <EmptyDataTemplate>
                                <asp:Label ID="lblEmpty" runat="server" ForeColor="Red" 
                                    meta:resourcekey="lblEmpty"></asp:Label>
                            </EmptyDataTemplate>
                        </TServerControl:TGridView>
                       
                    </td>
                </tr>
            </table>
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>
